{% extends "base.htm" %}
{% block header_title %}{{ user["username"] }}的资料 - 后台管理页面{% end %}

{% block body %}
<div class="am-cf admin-main">
  {% include "sidebar.htm" %}

  <!-- content start -->
  <div class="admin-content">

    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">首页</strong> / <small>{{ user['username'] }} 的资料</small></div>
    </div>

    <div class="am-g">

      <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">
        <div class="am-panel am-panel-default">
          <div class="am-panel-bd">
            <div class="am-g">
              <div class="am-u-lg-6">
                <img class="am-img-circle am-img-thumbnail" src="{{ get_avatar(user['_id']) }}" />
              </div>
              <div class="am-u-lg-6">
                <p class="am-text-sm">用户头像</p>
              </div>
            </div>
          </div>
        </div>

      </div>

      <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
        <form class="am-form am-form-horizontal" method="post" action="/admin/edituser">
          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">用户名</label>
            <div class="am-u-sm-9">
              <input disabled type="text" value="{{ user['username'] }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">金币</label>
            <div class="am-u-sm-9">
              <input name="money" type="text" value="{{ user['money'] }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">权限</label>
            <div class="am-u-sm-9">
                <input name="power" type="text" value="{{ user['power'] }}">
                <small>20为管理员，0为普通用户，-1为禁用</small>
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">电子邮件</label>
            <div class="am-u-sm-9">
              <input type="email" name="email" value="{{ user.get('email') }}" >
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">主页</label>
            <div class="am-u-sm-9">
              <input type="text" name="website" value="{{ user.get('website') }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">QQ</label>
            <div class="am-u-sm-9">
              <input type="text" name="qq" value="{{ user.get('qq') }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">地址</label>
            <div class="am-u-sm-9">
              <input type="text" name="address" value="{{ user.get('address') }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">个人说明</label>
            <div class="am-u-sm-9">
              <textarea name="signal" rows="5">{{ user.get('signal') }}</textarea>
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">密码</label>
            <div class="am-u-sm-9">
              <input type="password" name="password" placeholder="不修改密码请不要填写">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">注册时间</label>
            <div class="am-u-sm-9">
              <input disabled type="text" value="{{ humantime(user.get('time')) }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">上次登录时间</label>
            <div class="am-u-sm-9">
              <input disabled type="text" value="{{ humantime(user.get('logintime')) }}">
            </div>
          </div>

          <div class="am-form-group">
            <label class="am-u-sm-3 am-form-label">上次登录IP</label>
            <div class="am-u-sm-9">
              <input disabled type="text" value="{{ user.get('loginip') }}">
            </div>
          </div>

          <div class="am-form-group">
            <div class="am-u-sm-9 am-u-sm-push-3">
              <button type="submit" class="am-btn am-btn-primary">保存修改</button>
            </div>
          </div>
          <input type="hidden" name="id" value="{{ user['_id'] }}">
          {% raw xsrf_form_html() %}
        </form>
      </div>
    </div>

  </div>
  <!-- content end -->

</div>

<a class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

{% end %}